package com.hmall.common.thread;

public class UserThreadLocal {

    //1.声明threadlocal
    private  static  ThreadLocal<User> userThreadLocal=new ThreadLocal<>();

    //2.执行set
    public static void setUser(User user){
        userThreadLocal.set(user);
    }

    //3.执行get
    public static User getUser(){
        return userThreadLocal.get();
    }

    //4.删除threadLocal
    public static  void delUser(){
        userThreadLocal.remove();
    }

}
